//
//  Order.m
//  CommunityApp
//
//  Created by 秦乾龙 on 16/12/28.
//  Copyright © 2016年 秦乾龙. All rights reserved.
//

#import "Order.h"

@implementation Order
- (instancetype)initWithDic:(NSDictionary*)dic
{
    if ([dic isKindOfClass:[NSDictionary class]]) {
        self.orderStatus = [NSString stringWithFormat:@"%@",dic[@"status"]];
        if([dic[@"hyOrderDetail"] isKindOfClass:[NSDictionary class]])
        {
            self.sellerInfo =[[User alloc]initWithDic:dic[@"hyUser"]]
            ;
            self.goods = [[Goods alloc]initWithDic:dic[@"goods"]]
            ;
            self.buyUserId = dic[@"buy_user_id"];
            self.createTime = dic[@"create_tm"];
            self.allPrice = dic[@"hyOrderDetail"][@"amt"];
            self.price = dic[@"hyOrderDetail"][@"goods_preprice"];
            self.goodsNumber = dic[@"hyOrderDetail"][@"product_count"];
            self.goodsName = dic[@"hyOrderDetail"][@"goods_name"];
            self.goodsId = dic[@"hyOrderDetail"][@"goods_id"];
            self.freightMoney = dic[@"hyOrderDetail"][@"curr_mony"];
            self.orderId = dic[@"hyOrderDetail"][@"order_id"];
            self.sellerName = dic[@"hyOrderDetail"][@"goods_name"];
            
        }
        
    }
    //    self.name = dic[@"nick_name"];
    return self;
}

@end
